package com.five.matebook;

import android.app.Application;
import android.text.TextUtils;
import android.util.Log;

import com.five.filesync.FileCacheListRequest;
import com.five.filesync.FileListRequest;
import com.five.filesync.MdnsDisovery;
import com.five.filesync.OnNetCallback;
import com.five.matebook.activity.columeedit.CustomColume;
import com.five.matebook.activity.config.ConfigDataBean;
import com.five.matebook.activity.config.StroageConfig;
import com.five.matebook.activity.db.CustomValueTable;
import com.five.matebook.activity.db.DbHelper;
import com.five.matebook.activity.db.OneQueryData;
import com.five.matebook.activity.db.QueryFilter;
import com.five.matebook.activity.income.IncomeColume;
import com.five.matebook.activity.matebook.MateBookManager;
import com.five.matebook.activity.matebook.Matebook;
import com.five.matebook.activity.outcome.OutcomeColume;
import com.five.matebook.utils.DeviceUtils;

import java.io.File;
import java.net.InetAddress;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        DeviceUtils.init(getApplicationContext());
        String id = DeviceUtils.getDeviceUuid();
        Log.d("matebook", "uuid=" + id);
//        DbHelper.setsDbName(this, id);

        {
            // 加载全局配置
            ConfigDataBean bean = StroageConfig.get(getApplicationContext());
            MateBookManager mateBookManager = bean.getMateBookManager();
            mateBookManager.loadNowChoosedMatebook(getApplicationContext());
        }

        ServerDiscover.getInstance(getApplicationContext()).startDiscover(new MdnsDisovery.OnMdnsCallback() {
            @Override
            public void onServiceDiscoverd(InetAddress addr, int port) {

            }

            @Override
            public void onServiceNotFound(String serverName) {

            }
        });
    }

}
